/*
 * POJ2965: The Pilots Brothers' refrigerator
 */

/*-------- Includes --------*/
#include <stdio.h>
#include <stdlib.h>
#include <deque>

using namespace std;

/*-------- Types --------*/
typedef unsigned int uint_t;
class Refrigerator {
public:
    uint_t stat;
    uint_t oper;
public:
    Refrigerator()                   { stat = 0; oper = 0; }
    Refrigerator(uint_t s, uint_t o) { stat = s; oper = o; }

    ~Refrigerator()                  {                     }

    int  getCurStep();
    void print();
};

/*-------- Global Variables --------*/
const uint_t STAT_MASK[16] = {
    0x111F, 0x222F, 0x444F, 0x888F,
    0x11F1, 0x22F2, 0x44F4, 0x88F8,
    0x1F11, 0x2F22, 0x4F44, 0x8F88,
    0xF111, 0xF222, 0xF444, 0xF888
};

/*-------- Main Function --------*/
int main(int argc, char const *argv[])
{
    int    ch;
    uint_t origin = 0;
    uint_t mask   = 1;

    // get input
    while ((ch = getchar()) != EOF) {
        if      (ch == '+') { origin |= mask; mask <<= 1; }
        else if (ch == '-') {                 mask <<= 1; }
        else    continue;
    }

    /* Breadth First Search */
    deque<Refrigerator> q;
    Refrigerator        rfg(0, 0);

    q.push_back(rfg);

    while (!q.empty()) {
        // retrieve the element
        rfg = q.front(); q.pop_front();

        // base case
        if (rfg.stat == origin) { rfg.print(); break; }

        // flip the ith handle
        for (int i = rfg.getCurStep() + 1; i < 16; i++) {
            Refrigerator raw;

            raw.stat = rfg.stat ^ STAT_MASK[i];
            raw.oper = rfg.oper | (1 << i);

            q.push_back(raw);
        }
    }

    return 0;
}

/*-------- Refrigerator::Methods --------*/
int Refrigerator::getCurStep()
{
    uint_t mask = 0x8000;

    for (int i = 15; i >= 0; i--, mask >>= 1)
        if (oper & mask) return i;

    return -1;
}

void Refrigerator::print()
{
    int        count = 0;
    uint_t     mask  = 1;
    deque<int> q;

    for (int i = 0; i < 16; i++, mask <<= 1) {
        if (oper & mask) {
            q.push_back(i);
            count++;
        }
    }

    printf("%d\n", count);

    while (!q.empty()) {
        int x = q.front() / 4 + 1;
        int y = q.front() % 4 + 1;

        printf("%d %d\n", x, y);

        q.pop_front();
    }
}
